Page({

  /**
   * 页面的初始数据
   */
  data: {
    staticCategoryList: [{
        id: 1,
        name: '分类1',
        children: [{
            id: 11,
            name: '子分类1-1'
          }, {
            id: 12,
            name: '子分类1-2'
          },
          {
            id: 13,
            name: '子分类1-3'
          },
          {
            id: 14,
            name: '子分类1-4'
          },
          {
            id: 15,
            name: '子分类1-5'
          },
          {
            id: 16,
            name: '子分类1-6'
          },
          {
            id: 17,
            name: '子分类1-7'
          },
          {
            id: 18,
            name: '子分类1-8'
          },
          {
            id: 19,
            name: '子分类1-9'
          },
        ]
      },
      {
        id: 2,
        name: '分类2',
        children: [{
          id: 21,
          name: '子分类2-1'
        }, {
          id: 22,
          name: '子分类2-2'
        }, ]
      },
      {
        id: 3,
        name: '分类3',
        children: [{
            id: 31,
            name: '子分类3-1'
          }, {
            id: 32,
            name: '子分类3-2'
          },
          // 添加更多子分类
        ]
      },
      // 添加更多一级分类
    ],
    currentIndex: 0
    // 默认选择第一个一级分类
  },
  onCategoryTap(event) {
    const index = event.currentTarget.dataset.index;
    this.setData({
      currentIndex: index
    });
  }
})